package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.MonthDestination;
import cn.wolfcode.luowowo.article.mapper.MonthDestinationMapper;
import cn.wolfcode.luowowo.article.query.MonthDestinationQuery;
import cn.wolfcode.luowowo.article.service.IMonthDestinationService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class MonthDestinationServiceImpl implements IMonthDestinationService {

    @Autowired
    private MonthDestinationMapper monthDestinationMapper;

    @Override
    public void saveOrUpdate(MonthDestination monthDestination) {

        if(monthDestination.getId() == null){
            monthDestinationMapper.insert(monthDestination);
        }else{
            monthDestinationMapper.updateByPrimaryKey(monthDestination);
        }
    }

    @Override
    public MonthDestination get(Long rid) {
        return monthDestinationMapper.selectByPrimaryKey(rid);
    }

    @Override
    public List<MonthDestination> selectAll() {
        return monthDestinationMapper.selectAll();
    }

    @Override
    public List<MonthDestination> selectHoliday() {
        return monthDestinationMapper.selectHoliday();
    }


}
